﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Browsing the Library </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Browsing the Library ">
    <meta name="generator" content="docfx 2.59.2.0">
    
    <link rel="shortcut icon" href="../../favicon.ico">
    <link rel="stylesheet" href="../../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../../styles/docfx.css">
    <link rel="stylesheet" href="../../styles/main.css">
    <link rel="stylesheet" href="../../styles/socialbar.css">
    <link rel="stylesheet" href="../../styles/header.css">
    <link rel="stylesheet" href="../../styles/version.css">
    <link href="https://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,100italic,300italic,400italic" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <meta property="docfx:navrel" content="../../toc.html">
    <meta property="docfx:tocrel" content="../toc.html">
    <meta property="docfx:uid" content="doc-restapi-Browsing-the-Library">
    
    <meta property="docfx:rel" content="../../">
    
    <script type="text/javascript" src="../../nav.js"></script>
    <script type="text/javascript" src="../toc.js"></script>
  
  </head>  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <div class="mb-socials-heading" style="height: 40px;">
        	<div class="mb-socials-heading-inner container">
        		<div class="mb-socials-heading-right">
        			<div class="mb-socials-list">
                          
        				<div class="mb-socials-item facebook">
        					<a class="mb-socials-item-link" target="_blank" href="https://facebook.com/embyapp"></a>
        					<div class="mb-socials-item-popup">
        						<span>Facebook</span>
        					</div>
        				</div><div class="mb-socials-item twitter">
        					<a class="mb-socials-item-link" target="_blank" href="https://twitter.com/embyapp"></a>
        					<div class="mb-socials-item-popup">
        						<span>Twitter</span>
        					</div>
        				</div>
        				<div class="mb-socials-item pinterest">
        					<a class="mb-socials-item-link" target="_blank" href="https://www.pinterest.com/emby0240/emby-news/"></a>
        					<div class="mb-socials-item-popup">
        						<span>Pinterest</span>
        					</div>
        				</div>
        				<div class="mb-socials-item tumblr">
        					<a class="mb-socials-item-link" target="_blank" href="https://embyapp.tumblr.com/"></a>
        					<div class="mb-socials-item-popup">
        						<span>Tumblr</span>
        					</div>
        				</div>
        				<div class="mb-socials-item github">
        					<a class="mb-socials-item-link" target="_blank" href="https://github.com/MediaBrowser"></a>
        					<div class="mb-socials-item-popup">
        						<span>GitHub</span>
        					</div>
        				</div><div class="mb-socials-item rss">
        					<a class="mb-socials-item-link" target="_blank" href="https://emby.media/blog.xml"></a>
        					<div class="mb-socials-item-popup">
        						<span>RSS</span>
        					</div>
        				</div>
                          
        			</div>
        		</div>
        	</div>
        </div>
        <div class="container">
        	<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
        		  
        		  <a class="navbar-brand" href="../../index.html">
        		    <img id="logo" class="svg" src="../../images/emby_dev_logo.png" alt="">
        		  </a>
        		  <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
        			<span class="sr-only">Toggle navigation</span>
        			<span class="icon-bar"></span>
        			<span class="icon-bar"></span>
        			<span class="icon-bar"></span>
        		  </button>
        		<div class="collapse navbar-collapse" id="navbar">
        			
        			<ul class="nav level1 navbar-nav">
        			      <li class="nav-item">
        			          <a class="nav-link" href="../../index.html" title="DEV Home">DEV Home</a>
        			      </li>
        			      <li class="nav-item">
        			          <a class="nav-link" href="../../doc/index.html" title="Documentation">Documentation</a>
        			      </li>
        			      <li class="nav-item">
        			          <a class="nav-link" href="../../reference/index.html" title="Reference">Reference</a>
        			      </li>
        			      <li class="nav-item">
        			          <a class="nav-link" href="../../download/index.html" title="Download">Download</a>
        			      </li>
        			</ul>		</div>
        	</nav>
        </div>
        <div class="nav-overlay d-none"></div>        
        <div class="subnav navbar navbar-default">
          <div class="container">
            <div class="hide-when-search" id="breadcrumb">
        	  <ul class="breadcrumb">
        		<li></li>
        	  </ul>
        	</div>
        
        	<div class="breadcrumpsearch">
        	  <form class="navbar-form navbar-right" role="search" id="search">
        		<div class="form-group">
        		  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
        		</div>
        	  </form>
        	</div>
          </div>
        </div>
      </header>
      <div class="container body-content">
        
        <div id="search-results">
          <div class="search-list">Search Results for <span></span></div>
          <div class="sr-items">
            <p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
          </div>
          <ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
        </div>
      </div>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="doc-restapi-Browsing-the-Library">
<h1 id="browsing-the-library">Browsing the Library</h1>

<p>This page will detail how to retrieve items for display and browsing purposes.</p>
<h2 id="displaying-a-folder">Displaying a Folder</h2>
<p>After authentication, the next step is generally to start displaying the user's library.</p>
<h2 id="user-views">User Views</h2>
<p>User views represent the user's top level categories, and can be retrieved from:</p>
<ul>
<li><a class="xref" href="../../reference/RestAPI/UserViewsService/getUsersByUseridViews.html">/Users/{UserId}/Views</a></li>
</ul>
<p>The items from a view can then be retrieved generically using:</p>
<ul>
<li><a class="xref" href="../../reference/RestAPI/ItemsService/getUsersByUseridItems.html">/Users/{UserId}/Items?parentId={ViewId}</a></li>
</ul>
<p>All views support this style of generic navigation. Each item will have several properties to determine how to display it, e.g. <strong>IsFolder</strong> (true/false), <strong>MediaType</strong> (Audio/Video/Photo/Book/Game) and <strong>Type</strong>.</p>
<p>See Item-Information</p>
<h2 id="customized-presentations">Customized Presentations</h2>
<p>While it's possible to display user views using generic navigation, often you'll want to customize based on the view type. Each view has a <strong>CollectionType</strong> property to indicate the view type. Available values are:</p>
<ul>
<li>movies</li>
<li>tvshows</li>
<li>music</li>
<li>games</li>
<li>books</li>
<li>musicvideos</li>
<li>homevideos</li>
<li>livetv</li>
<li>channels</li>
</ul>
<p>If <strong>CollectionType</strong> is null, it indicates a mixed movie/tv folder that should be displayed generically.</p>
<p>A customized view can then be built by retrieving data pertaining to that view, e.g. latest movies, all movies, upcoming episodes, etc.</p>
<p>Displaying a customized view of live tv or channels will require use of the specific api's for those features.</p>
<h2 id="sorting">Sorting</h2>
<p>Use the SortBy param to supply the fields to sort on. This supports multiple sort orders using a comma delimited list. Use SortOrder to specify ascending or descending order. The following example sorts by Artist, and then Album, in Ascending order:</p>
<pre><code class="lang-restApi">http://localhost:8096/emby/Users/e8837bc1ad67520e8cd2f629e3155721/Items?ParentId=20aef3be-ebda-f0d4-0096-8d179783e918&amp;SortBy=Artist,Album&amp;SortOrder=Ascending
</code></pre>
<p>Multiple sort orders are supported. For example, let's say you'd like to sort albums by release date descending, then by sort name ascending. Your params would look like:</p>
<pre><code class="lang-restApi">SortBy=ProductionYear,PremiereDate,SortName&amp;SortOrder=Descending,Descending,Ascending
</code></pre>
<h2 id="fields">Fields</h2>
<p>When you request a single item using the /Users/{UserId}/Items/{Id} api, you will get back the entire item. When requesting lists of items, the data coming back will be much smaller in order to make it easier to retrieve large result sets.</p>
<p>If you want to add additional fields to the items, use the fields param, which is a comma-delimited list of fields to include in the output. See the swagger documentation for a full listing of available fields. Here is an example which adds SortName and PrimaryImageAspectRatio:</p>
<pre><code class="lang-restApi">GET http://localhost:8096/emby/Users/e8837bc1ad67520e8cd2f629e3155721/Items?ParentId=20aef3be-ebda-f0d4-0096-8d179783e918&amp;Fields=PrimaryImageAspectRatio,SortName
</code></pre>
<h2 id="query-based-views">Query-based views</h2>
<p>If you would like to present virtual views based on queries, the api will allow you to do that. Use the Recursive=true param to search recursively. Here are a few examples:</p>
<h3 id="display-resumeable-items-limit-to-20-results-and-sort-by-date-played">Display resumeable items, limit to 20 results and sort by date played</h3>
<pre><code class="lang-restApi">http://localhost:8096/emby/Users/e8837bc1ad67520e8cd2f629e3155721/Items?Limit=20&amp;Recursive=true&amp;SortBy=DatePlayed&amp;SortOrder=Descending&amp;Filters=IsResumable
</code></pre>
<h3 id="display-all-movies">Display all Movies</h3>
<pre><code class="lang-restApi">http://localhost:8096/emby/Users/e8837bc1ad67520e8cd2f629e3155721/Items?Recursive=true&amp;IncludeItemTypes=Movie
</code></pre>
<h3 id="display-all-episodes">Display all Episodes</h3>
<pre><code class="lang-restApi">http://localhost:8096/emby/Users/e8837bc1ad67520e8cd2f629e3155721/Items?Recursive=true&amp;IncludeItemTypes=Episode
</code></pre>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                </ul>
              </div>
              <div class="sdkversion Release">
                  SDK <span class="sdkVersionSpan"></span>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
                <h5>On this Page</h5>
                <div></div>
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to Top</a>
            </span>
            Copyright 2022 © EMBY LLC.  Please see our <a class="lnk" href="https://emby.media/terms.html">terms of use</a> and <a class="lnk" href="https://emby.media/privacy.html">privacy policy</a>.
            
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../../searchIndex.js"></script>
    <script type="text/javascript" src="../../styles/lunr.min.js"></script>
    <script type="text/javascript" src="../../styles/docfx.js"></script>
    <script type="text/javascript" src="../../styles/main.js"></script>
  </body>
</html>
